import { Module, VuexModule, Mutation, Action } from 'vuex-module-decorators';

// import type {Visitor as VisitorType} from '@/models/visitor'
import { Global } from 'src/models/global';
import mutation from './module-example/mutations';

@Module<Global>({
  stateFactory: true,
  namespaced: true
})
export default class GlobalStateModule extends VuexModule {
  //滚动条距离顶部距离
  scrollToTop: number = 0;

  //加载失败默认图片
  defaultImg: string = 'src/assets/images/errorImg2.png';

  loginDialogVisible: boolean = false;

  @Mutation
  SET_SCROLL_TOP(top: number) {
    this.scrollToTop = top;
  }

  @Mutation
  SET_LOGIN_DIALOG_VISIBLE(visible: boolean) {
    this.loginDialogVisible = visible;
  }
}
